package com.woniu.service.impl;

import com.woniu.adapter.RepairAdapter;
import com.woniu.outlet.po.RepairApplication;
import com.woniu.service.RepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RepairServiceImpl implements RepairService {
    @Autowired
    private RepairAdapter repairAdapter;

    /** 获取返修申请列表
     * @param orderCode
     * @return
     */
    @Override
    public List<RepairApplication> getRepairApplicationList(String orderCode){
        return repairAdapter.getRepairApplicationList(orderCode);
    }

    /** 获取已申请的返修列表
     * @param orderCode
     * @return
     */
    @Override
    public List<RepairApplication> getRepairList(String orderCode){
        return repairAdapter.getRepairList(orderCode);
    }

    /** 获取需要返修校验的列表
     * @param orderCode
     * @return
     */
    @Override
    public List<RepairApplication> getCheck(String orderCode){
        return repairAdapter.getCheck(orderCode);
    }


    /** 根据id获取返修详情  也就是两张表的数据 一张返修申请表 一张返修验收表
     * @param id
     * @return
     */
    @Override
    public RepairApplication getRepairApplicationDetail(Integer id){
        return repairAdapter.getRepairApplicationDetail(id);
    }

    /** 根据订单编号查询所有已经生产完成的
     * @param orderCode
     * @return
     */
    @Override
    public List<RepairApplication> getProducted (String orderCode) {
        return repairAdapter.getProducted(orderCode);
    }
}
